﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Fire : MonoBehaviour
{
    public bool isFiring = false;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    GameObject tempgo;
    public void AddItem(GameObject go)
    {
        go.transform.position = transform.position;
        go.transform.rotation = Quaternion.Euler(new Vector3(0, 210, 0));
        tempgo = go;
        StartCoroutine(IEFinishFire());
    }

    IEnumerator IEFinishFire()
    {
        yield return new WaitForSeconds(5);
        GameController.instance.table.EnqueueChuan(tempgo);
    }

    private void OnMouseUp()
    {
        if (!isFiring)
        {
            GameController.instance.uiFire.SetActive(true);
            GameController.instance.uiFire.GetComponent<UIFire>().fire = this;
        }
    }
}
